package com.zouma;

import com.zouma.pojo.Cntrparty;
import com.zouma.pojo.HistCapitalFlow;
import com.zouma.service.HistCapitalFlowService;
import com.zouma.utils.DBEasyhepler;

import java.util.List;

/**
 * @Author: serein
 * @DateTime: 2021/7/8 21:28
 * @Description:
 */
public class ExcelToDbHis {

    public static void main(String[] args) {

        List<HistCapitalFlow> list = HistCapitalFlowService.getAllByExcel("d://3.xls");

        DBEasyhepler db=new DBEasyhepler();

        for (HistCapitalFlow histCapitalFlow : list) {

            String sql="insert into histCapitalFlow" +
                    "(id,occurrenceDate,securityName,securityCode," +
                    "dealVolume,capitalOccurCount,dealPrice,dealMoney," +
                    "innerCapitalAccount,businessCategory,exchangeCurrency,exchangeCode,assetLiabCategory,marketCode,productCode) " +
                    "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

            String[] str=new String[]{
                    histCapitalFlow.getId(), histCapitalFlow.getOccurrenceDate(),histCapitalFlow.getSecurityName(),histCapitalFlow.getSecurityCode(),
                    histCapitalFlow.getDealVolume(),histCapitalFlow.getCapitalOccurCount(), histCapitalFlow.getDealPrice(),histCapitalFlow.getDealMoney(),
                    histCapitalFlow.getInnerCapitalAccount(), histCapitalFlow.getBusinessCategory(), histCapitalFlow.getExchangeCurrency(),
                    histCapitalFlow.getExchangeCode(),histCapitalFlow.getAssetLiabCategory(),histCapitalFlow.getMarketCode(),histCapitalFlow.getProductCode()};
           db.AddU(sql, str);
        }
    }
}
